package cn.edu.wynu.operator;

public class OperatorDemo01 {
    public static void main(String[] args) {
        // 基本算术运算符
        int a = 10;
        int b = 5;
        System.out.println(a + b);
        System.out.println(a - b);
        System.out.println(a * b);
        System.out.println(a / b);
        System.out.println(9 / b); // 输出为1
        System.out.println(1.0 * 9 / b); // 输出为1.8
        System.out.println(9 % b); // 余4 输出为4

        System.out.println("-------------------------------------------------");

        // '+' 做为字符串拼接符（连接符）
        int age = 20;
        System.out.println("我今年" + age + "岁");
        System.out.println(age + 'a' + "dys"); // 输出为 117dys，20+97=117
        System.out.println(age + "dys" + 'a'); // 输出为 20dysa






    }
}
